{% ifequal path "home" %}
  <script>
    function showComments(postid){
      cdiv = document.getElementById("h"+postid);
      cifr = document.getElementById("i"+postid);
      if (cdiv.style.display  == ""){
        cdiv.style.display = "block";
        if (!cifr.src){
          cifr.src = "/comment.html?postid="+postid;
        }
      }
      else{
        cdiv.style.display = "";
      }
    }
  </script>
{% endifequal %}
{% if "/admin/" in path %}
  <script type="text/javascript">
    function ajaxCall(url, fillobj)
    {
      var xmlhttp;
      if (window.XMLHttpRequest)
        {// for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
        }
      else
        {// for IE6
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      xmlhttp.onreadystatechange=function()
        {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
          {
          document.getElementById(fillobj).innerHTML=xmlhttp.responseText;
          }
        }
      xmlhttp.open("GET",url,true);
      xmlhttp.send();
    }
    
    function clearCache(){
      notice = document.getElementById("notice");
      notice.innerHTML = "Clearing Memcache...";
      notice.style.display = "block";
      ajaxCall("/admin/clear-cache","notice");
    }
  </script>
{% endif %}
